package com.chujian.core.entity;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chujian.framework.core.IId;
import com.chujian.framework.core.IIdName;
import com.chujian.framework.core.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


/**
 * 产品表
 *
 * @author yj
 * @since 2021-07-28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("core_prod")
@KeySequence("core_prod_seq")
public class CoreProd extends BaseEntity implements IId, IIdName {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "产品id")
    @TableId("prod_id")
    private Long prodId;


    @ApiModelProperty(value = "产品id")
    @TableField("prod_name")
    private String prodName;


    // ++++++ 系统拓展 +++++++
    @TableField(exist = false)
    private Map<String, String> query = new HashMap<>();

    @Override
    public Long getId() {
        return this.prodId;
    }

    @Override
    public void setId(Serializable id) {
        if (null != id) {
            this.prodId = Long.parseLong("" + id);
        }
    }

    @Override
    public String getName() {
        return this.prodName;
    }
    // ++++++ 业务拓展 +++++++
}
